package com.toby.ioc.iocprinciple;

import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.context.annotation.*;

/**
 * @desc:
 * @author: jonathan.zhang
 * @date: 2019/7/22 22:18
 */
@Configuration
@ComponentScan(basePackages = {"com.toby.ioc.iocprinciple"})
@ImportResource("classpath:circulation-di.xml")
@Import(PrincipleService.class)
public class PrincipleConfig {
    @Bean
    public PrincipleBean principleBean(){
        return new PrincipleBean();
    }

    //@Bean(autowire = Autowire.BY_TYPE)
    @Bean
    public PrincipleAspect principleAspect(){
        return new PrincipleAspect();
    }

    @Bean
    @Primary
    public PrincipleLog principleLog(){
        return new PrincipleLog();
    }

    @Bean
    public PrincipleLog principleLog2(){
        return new PrincipleLog();
    }
}
